package com.soen6441.generics;
// first bound should be concrete class
// followed by as many interface bounds as desired
class ClassBounds<T extends Printer & Doable> {
    T t;

    ClassBounds(T t) {
        this.t = t;
    }

    void doSomething(){
        // now T is erased to
        // lower bounds Printer & Doable
        // so it can call anything on Object
        // on Printer or Doable
        t.doSomething();
        t.print();
    }

    public static void main(String[] args) {
        // won't compile bounds restrictions
        // not satisifed
        //ClassBounds<String> notCompile
        //        = new ClassBounds<String>();
        // compiles fine meets bounds
        // restrictions
        ClassBounds<PrinterDoable> compiles =
                new ClassBounds<PrinterDoable>( new PrinterDoable());

    }
}
